<?php
/**
 * Created by PhpStorm.
 * User: Lyq
 * Date: 2018/8/22
 * Time: 上午8:21
 */
namespace app\bussiness\controller;

use think\Exception;
use think\Db;

class Duties extends Common
{

    public function index()
    {
        $this->templateTitle('职务列表');

        //判断条件
        $where=[];

        //搜索条件
        $condition = request()->param("condition");
        $this->assign("condition", $condition);
        if ($condition)
        {
            $where["title"] = ["LIKE", "%$condition%"];
        }

        $list = Db::name("Duties")
            ->where($where)
            ->order("level ASC,display_order DESC")
            ->paginate(15);
        $this->assign("list", $list);

        return $this->fetch();
    }


}